<?php
$this->menu=array(
	array('label'=>'Create new User', 'url'=> $this->module_name.'/user/create'),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#user-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>
<h1>Manage Users</h1>

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'user-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		array(
			'name' => 'id',
			'htmlOptions' => array(
				'style' => 'width:40px'
			),
		),
		'username',
		'email',
		array(
			'name' => 'amount',
			'htmlOptions' => array('style' => 'text-align:right')
		),
		array(
			'name' => 'code',
			'type' => 'raw'
		),
		array(
			'name' => 'status',
			'type'   => 'html',
			'value'  => '$data->getStatusHtml()'
		),
		'created_at',
		array(
			'class'=>'CButtonColumn',
		),
	),
)); ?>
